file(GLOB Sources "*.wast")
add_custom_target(SpecTests SOURCES ${Sources})

set(TEST_BIN ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CONFIGURATION}/Test)

add_test(WAVM_known_failures ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/WAVM_known_failures.wast)

add_test(address ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/address.wast)
add_test(align ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/align.wast)
add_test(atomic ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/atomic.wast)
add_test(binary ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/binary.wast)
add_test(block ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/block.wast)
add_test(br ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/br.wast)
add_test(break-drop ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/break-drop.wast)
add_test(br_if ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/br_if.wast)
add_test(br_table ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/br_table.wast)
add_test(call ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/call.wast)
add_test(call_indirect ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/call_indirect.wast)
add_test(comments ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/comments.wast)
add_test(const ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/const.wast)
add_test(conversions ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/conversions.wast)
add_test(custom_section ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/custom_section.wast)
add_test(elem ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/elem.wast)
add_test(endianness ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/endianness.wast)
add_test(exports ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/exports.wast)
add_test(f32 ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/f32.wast)
add_test(f32_bitwise ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/f32_bitwise.wast)
add_test(f32_cmp ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/f32_cmp.wast)
add_test(f64 ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/f64.wast)
add_test(f64_bitwise ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/f64_bitwise.wast)
add_test(f64_cmp ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/f64_cmp.wast)
add_test(fac ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/fac.wast)
add_test(float_exprs ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/float_exprs.wast)
add_test(float_literals ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/float_literals.wast)
add_test(float_memory ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/float_memory.wast)
add_test(float_misc ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/float_misc.wast)
add_test(forward ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/forward.wast)
add_test(func ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/func.wast)
add_test(func_ptrs ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/func_ptrs.wast)
add_test(get_local ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/get_local.wast)
add_test(globals ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/globals.wast)
add_test(i32 ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/i32.wast)
add_test(i64 ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/i64.wast)
add_test(if ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/if.wast)
add_test(imports ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/imports.wast)
add_test(int_exprs ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/int_exprs.wast)
add_test(int_literals ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/int_literals.wast)
add_test(labels ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/labels.wast)
add_test(left-to-right ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/left-to-right.wast)
add_test(linking ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/linking.wast)
add_test(loop ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/loop.wast)
add_test(memory ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/memory.wast)
add_test(memory_redundancy ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/memory_redundancy.wast)
add_test(memory_trap ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/memory_trap.wast)
add_test(names ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/names.wast)
add_test(nop ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/nop.wast)
add_test(resizing ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/resizing.wast)
add_test(return ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/return.wast)
add_test(select ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/select.wast)
add_test(set_local ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/set_local.wast)
#add_test(skip-stack-guard-page ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/skip-stack-guard-page.wast)
add_test(start ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/start.wast)
add_test(stack ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/stack.wast)
add_test(store_retval ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/store_retval.wast)
add_test(switch ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/switch.wast)
add_test(tee_local ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/tee_local.wast)
add_test(token ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/token.wast)
add_test(traps ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/traps.wast)
add_test(type ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/type.wast)
add_test(typecheck ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/typecheck.wast)
add_test(unreachable ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/unreachable.wast)
add_test(unreached-invalid ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/unreached-invalid.wast)
add_test(unwind ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/unwind.wast)
add_test(utf8-invalid-encoding ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/utf8-invalid-encoding.wast)
add_test(utf8-custom-section-id ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/utf8-custom-section-id.wast)
add_test(utf8-import-field ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/utf8-import-field.wast)
add_test(utf8-import-module ${TEST_BIN} ${CMAKE_CURRENT_LIST_DIR}/utf8-import-module.wast)
